package section1;
/*
	Sample Input
	2
	4 1 2 3 4
	5 1 2 3 4 5
	Sample Output
	10
	15
 * */
import java.util.Scanner;
public class PracticeV {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n,m,sum;
		n = sc.nextInt();
		while((n--)>0){
			m = sc.nextInt();
			sum = 0;
			for(int i=0; i<m; i++){
				sum = sum + sc.nextInt();
			}
			System.out.println(sum);
		}
	}
}
